package cn.ddiancan.schedule.base.domain;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ExecuteTypeEnum {
    Bean(1, "Bean"),
    URL(2, "URL"),
    UNKNOWN(3, "未知");

    private Integer code;

    private String desc;

    public static ExecuteTypeEnum getExecuteTypeEnum(Integer code) {
        for (ExecuteTypeEnum executeTypeEnum : ExecuteTypeEnum.values()) {
            if (executeTypeEnum.getCode().equals(code)) {
                return executeTypeEnum;
            }
        }
        return UNKNOWN;
    }
}
